#pragma once
#include <iostream>
#include "modbus.h"


class CRtu
{
public:
	CRtu(void);
	~CRtu(void);

	bool Open(const std::string& name, int slave);
	bool Close();

	std::string ReadBits(int adress, int len);
	std::string ReadRegistors(int adress, int len);
	std::string WriteBits(int adress, unsigned int len, std::string& req);
private:
	modbus_t *_ctx;

};

